def gen_dict(self, documentL):
    word2id_dict = {}
    id2word_dict = {}
    docs = []
    cnt_document = []
    cnt_word_id = 0

    for document in documentL:
        segList = jieba.cut(document)
        for word in segList:
            word = word.strip()
            if len(word) > 1 and word not in stopWordL:
                if word in word2id_dict:
                    cnt_document.append(word2id_dict[word])
                else:
                    cnt_document.append(cnt_word_id)
                    word2id_dict[word] = cnt_word_id
                    id2word_dict[cnt_word_id] = word
                    cnt_word_id += 1
        docs.append(cnt_document)
        cnt_document = []
    self.docs, self.word2id_dict, self.id2word_dict = docs, word2id_dict, id2word_dict
    self.num_doc = len(self.docs)
    self.num_word = len(self.word2id_dict)